const ARTICLE_STATUS = [
  { id: -1, title: '全部', color: 'magenta' },
  { id: 0, title: '草稿', color: 'red' },
  { id: 1, title: '待审核', color: 'volcano' },
  { id: 2, title: '审核通过', color: 'lime' },
  { id: 3, title: '审核失败', color: 'gold' }
]

// 你的代码，把 ARTICLE_STATUS ====> ARTICLE_STATUS_MAP

const ARTICLE_STATUS_MAP = ARTICLE_STATUS.reduce((acc, cur) => {
  acc[cur.id] = cur
  return acc
}, {})

// const ARTICLE_STATUS_MAP = ARTICLE_STATUS.reduce((acc, cur) => (acc[cur.id] = cur, acc),
//   {})
// const ARTICLE_STATUS_MAP = {
//   '-1': { id: -1, title: '全部', color: 'magenta' },
//   0: { id: 0, title: '草稿', color: 'red' },
//   1: { id: 1, title: '待审核', color: 'volcano' },
//   2: { id: 2, title: '审核通过', color: 'lime' },
//   3: { id: 3, title: '审核失败', color: 'gold' }
// }

export {
  ARTICLE_STATUS,
  ARTICLE_STATUS_MAP
}
